\hypertarget{classcalico_1_1sensors_1_1Sensor}{}\doxysection{calico\+::sensors\+::Sensor Class Reference}
\label{classcalico_1_1sensors_1_1Sensor}\index{calico::sensors::Sensor@{calico::sensors::Sensor}}


{\ttfamily \#include $<$sensor\+\_\+base.\+h$>$}



Inheritance diagram for calico\+::sensors\+::Sensor\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcalico_1_1sensors_1_1Sensor__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_aa9491c153bcd2dbba98627d5047cc66a}\label{classcalico_1_1sensors_1_1Sensor_aa9491c153bcd2dbba98627d5047cc66a}} 
virtual void \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_aa9491c153bcd2dbba98627d5047cc66a}{Set\+Name}} (const std\+::string \&name)=0
\begin{DoxyCompactList}\small\item\em Setter for name. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_a7188f41932ea342932ccc4065281b623}\label{classcalico_1_1sensors_1_1Sensor_a7188f41932ea342932ccc4065281b623}} 
virtual const std\+::string \& \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_a7188f41932ea342932ccc4065281b623}{Get\+Name}} () const =0
\begin{DoxyCompactList}\small\item\em Getter for name. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_ab0cdb2a4a36500b22c1c27b51955a6a8}\label{classcalico_1_1sensors_1_1Sensor_ab0cdb2a4a36500b22c1c27b51955a6a8}} 
virtual void \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_ab0cdb2a4a36500b22c1c27b51955a6a8}{Set\+Extrinsics}} (const \mbox{\hyperlink{classcalico_1_1Pose3}{Pose3d}} \&T\+\_\+sensorrig\+\_\+sensor)=0
\begin{DoxyCompactList}\small\item\em Setter for extrinsics parameters. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_a1aa9904a248e5d541be7f13d3447ace5}\label{classcalico_1_1sensors_1_1Sensor_a1aa9904a248e5d541be7f13d3447ace5}} 
virtual const \mbox{\hyperlink{classcalico_1_1Pose3}{Pose3d}} \& \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_a1aa9904a248e5d541be7f13d3447ace5}{Get\+Extrinsics}} () const =0
\begin{DoxyCompactList}\small\item\em Getter for extrinsics parameters. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_ad0f96e3a90e36a8797998ec02fab71fc}\label{classcalico_1_1sensors_1_1Sensor_ad0f96e3a90e36a8797998ec02fab71fc}} 
virtual absl\+::\+Status \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_ad0f96e3a90e36a8797998ec02fab71fc}{Set\+Intrinsics}} (const Eigen\+::\+Vector\+Xd \&intrinsics)=0
\begin{DoxyCompactList}\small\item\em Setter for intrinsics parameters. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_a46837cc3e6eb96518356e5362ca152da}\label{classcalico_1_1sensors_1_1Sensor_a46837cc3e6eb96518356e5362ca152da}} 
virtual const Eigen\+::\+Vector\+Xd \& \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_a46837cc3e6eb96518356e5362ca152da}{Get\+Intrinsics}} () const =0
\begin{DoxyCompactList}\small\item\em Getter for intrinsics parameters. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_af932ab758f883f08ab564ebba781a6e3}\label{classcalico_1_1sensors_1_1Sensor_af932ab758f883f08ab564ebba781a6e3}} 
virtual absl\+::\+Status \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_af932ab758f883f08ab564ebba781a6e3}{Set\+Latency}} (double latency)=0
\begin{DoxyCompactList}\small\item\em Setter for sensor latency. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_a16426cb65ee8e154b51bf86e82e0e793}\label{classcalico_1_1sensors_1_1Sensor_a16426cb65ee8e154b51bf86e82e0e793}} 
virtual double \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_a16426cb65ee8e154b51bf86e82e0e793}{Get\+Latency}} () const =0
\begin{DoxyCompactList}\small\item\em Getter for sensor latency. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_aa4fba629e7267af511b70cbcd5727df3}\label{classcalico_1_1sensors_1_1Sensor_aa4fba629e7267af511b70cbcd5727df3}} 
virtual void \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_aa4fba629e7267af511b70cbcd5727df3}{Enable\+Extrinsics\+Estimation}} (bool enable)=0
\begin{DoxyCompactList}\small\item\em Enable or disable extrinsics estimation. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_ace74aed01a0a9f152e26205aef3f49f5}\label{classcalico_1_1sensors_1_1Sensor_ace74aed01a0a9f152e26205aef3f49f5}} 
virtual void \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_ace74aed01a0a9f152e26205aef3f49f5}{Enable\+Intrinsics\+Estimation}} (bool enable)=0
\begin{DoxyCompactList}\small\item\em Enable or disable intrinsics estimation. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_a884df42081a0be6e09fe923478324680}\label{classcalico_1_1sensors_1_1Sensor_a884df42081a0be6e09fe923478324680}} 
virtual void \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_a884df42081a0be6e09fe923478324680}{Enable\+Latency\+Estimation}} (bool enable)=0
\begin{DoxyCompactList}\small\item\em Enable or disable latency estimation. \end{DoxyCompactList}\item 
virtual absl\+::\+Status \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_af08e6476f0188cdb77cf912a9026709a}{Update\+Residuals}} (ceres\+::\+Problem \&problem)=0
\begin{DoxyCompactList}\small\item\em Update residuals for this sensor. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_a8766d4d9b38c440f7dede45a5b24f432}\label{classcalico_1_1sensors_1_1Sensor_a8766d4d9b38c440f7dede45a5b24f432}} 
virtual void \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_a8766d4d9b38c440f7dede45a5b24f432}{Clear\+Residual\+Info}} ()=0
\begin{DoxyCompactList}\small\item\em Clear all stored info about residuals. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_ad0a0b27cd6022fe84e141d20a987a2cf}\label{classcalico_1_1sensors_1_1Sensor_ad0a0b27cd6022fe84e141d20a987a2cf}} 
virtual void \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_ad0a0b27cd6022fe84e141d20a987a2cf}{Set\+Loss\+Function}} (\mbox{\hyperlink{namespacecalico_1_1utils_aacede3df540b75d2e131f113380f0ce9}{utils\+::\+Loss\+Function\+Type}} loss, double scale=1.\+0)=0
\begin{DoxyCompactList}\small\item\em Setter for loss function and scale. \end{DoxyCompactList}\item 
virtual absl\+::\+Status\+Or$<$ int $>$ \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_a54f63f5a3b982b444d3a77724ec0a4cd}{Add\+Parameters\+To\+Problem}} (ceres\+::\+Problem \&problem)=0
\begin{DoxyCompactList}\small\item\em Add this sensor\textquotesingle{}s calibration parameters to the ceres problem. \end{DoxyCompactList}\item 
virtual absl\+::\+Status\+Or$<$ int $>$ \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_a7b60ca0610c6caa6a3278f7da5a251d8}{Add\+Residuals\+To\+Problem}} (ceres\+::\+Problem \&problem, \mbox{\hyperlink{classcalico_1_1Trajectory}{Trajectory}} \&sensorrig\+\_\+trajectory, \mbox{\hyperlink{classcalico_1_1WorldModel}{World\+Model}} \&world\+\_\+model)=0
\begin{DoxyCompactList}\small\item\em Contribue this sensor\textquotesingle{}s residuals to the ceres problem. \end{DoxyCompactList}\item 
virtual absl\+::\+Status \mbox{\hyperlink{classcalico_1_1sensors_1_1Sensor_afd3eac9105c7168c64212bfdf20f04fa}{Set\+Measurement\+Noise}} (double sigma)=0
\begin{DoxyCompactList}\small\item\em Set the measurement noise $\sigma$. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Base class for sensors. For the sake of readability, we make this a purely virtual class, so setters and getters must be implemented at the derived class level. 

\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_a54f63f5a3b982b444d3a77724ec0a4cd}\label{classcalico_1_1sensors_1_1Sensor_a54f63f5a3b982b444d3a77724ec0a4cd}} 
\index{calico::sensors::Sensor@{calico::sensors::Sensor}!AddParametersToProblem@{AddParametersToProblem}}
\index{AddParametersToProblem@{AddParametersToProblem}!calico::sensors::Sensor@{calico::sensors::Sensor}}
\doxysubsubsection{\texorpdfstring{AddParametersToProblem()}{AddParametersToProblem()}}
{\footnotesize\ttfamily virtual absl\+::\+Status\+Or$<$int$>$ calico\+::sensors\+::\+Sensor\+::\+Add\+Parameters\+To\+Problem (\begin{DoxyParamCaption}\item[{ceres\+::\+Problem \&}]{problem }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Add this sensor\textquotesingle{}s calibration parameters to the ceres problem. 

Returns the number of parameters added to the problem, which should be intrinsics + extrinsics + latency. If the sensor\textquotesingle{}s model hasn\textquotesingle{}t been set yet, it will return an invalid argument error. 

Implemented in \mbox{\hyperlink{classcalico_1_1sensors_1_1Gyroscope_ac6a5c8408e1822a1b80d71cd86893505}{calico\+::sensors\+::\+Gyroscope}}, \mbox{\hyperlink{classcalico_1_1sensors_1_1Camera_a716548611fcd3de2fa5da2ae04c3d951}{calico\+::sensors\+::\+Camera}}, and \mbox{\hyperlink{classcalico_1_1sensors_1_1Accelerometer_ad662a04d9dc1fa620d674260a10ef584}{calico\+::sensors\+::\+Accelerometer}}.

\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_a7b60ca0610c6caa6a3278f7da5a251d8}\label{classcalico_1_1sensors_1_1Sensor_a7b60ca0610c6caa6a3278f7da5a251d8}} 
\index{calico::sensors::Sensor@{calico::sensors::Sensor}!AddResidualsToProblem@{AddResidualsToProblem}}
\index{AddResidualsToProblem@{AddResidualsToProblem}!calico::sensors::Sensor@{calico::sensors::Sensor}}
\doxysubsubsection{\texorpdfstring{AddResidualsToProblem()}{AddResidualsToProblem()}}
{\footnotesize\ttfamily virtual absl\+::\+Status\+Or$<$int$>$ calico\+::sensors\+::\+Sensor\+::\+Add\+Residuals\+To\+Problem (\begin{DoxyParamCaption}\item[{ceres\+::\+Problem \&}]{problem,  }\item[{\mbox{\hyperlink{classcalico_1_1Trajectory}{Trajectory}} \&}]{sensorrig\+\_\+trajectory,  }\item[{\mbox{\hyperlink{classcalico_1_1WorldModel}{World\+Model}} \&}]{world\+\_\+model }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Contribue this sensor\textquotesingle{}s residuals to the ceres problem. 

{\ttfamily sensorrig\+\_\+trajectory} is the world-\/from-\/sensorrig trajectory $\mathbf{T}^w_r(t)$. 

Implemented in \mbox{\hyperlink{classcalico_1_1sensors_1_1Gyroscope_ae882341a2ea6aa26bee515ca45d5424f}{calico\+::sensors\+::\+Gyroscope}}, \mbox{\hyperlink{classcalico_1_1sensors_1_1Camera_ade8c66c0e1e8a1e18b8a42ebeec5b2f2}{calico\+::sensors\+::\+Camera}}, and \mbox{\hyperlink{classcalico_1_1sensors_1_1Accelerometer_a18f345438e5d1c919e8a2842491552fd}{calico\+::sensors\+::\+Accelerometer}}.

\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_afd3eac9105c7168c64212bfdf20f04fa}\label{classcalico_1_1sensors_1_1Sensor_afd3eac9105c7168c64212bfdf20f04fa}} 
\index{calico::sensors::Sensor@{calico::sensors::Sensor}!SetMeasurementNoise@{SetMeasurementNoise}}
\index{SetMeasurementNoise@{SetMeasurementNoise}!calico::sensors::Sensor@{calico::sensors::Sensor}}
\doxysubsubsection{\texorpdfstring{SetMeasurementNoise()}{SetMeasurementNoise()}}
{\footnotesize\ttfamily virtual absl\+::\+Status calico\+::sensors\+::\+Sensor\+::\+Set\+Measurement\+Noise (\begin{DoxyParamCaption}\item[{double}]{sigma }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Set the measurement noise $\sigma$. 

This value is used to weight the sensor\textquotesingle{}s residuals such that\+: \[ \boldsymbol{\Sigma} = \sigma^2\mathbf{I}\\ \boldsymbol{\epsilon} = \boldsymbol{\Sigma}^{-1/2}\left(\mathbf{y} - \mathbf{\hat{y}}\left(\mathbf{x}, \boldsymbol{\beta}\right)\right)\\ \mathbf{J} = \frac{\partial\boldsymbol{\epsilon}}{\partial\delta\boldsymbol{\beta}}\\ \delta\boldsymbol{\beta} = \left(\mathbf{J}^T\mathbf{J}\right)^{-1}\mathbf{J}^T\boldsymbol{\epsilon} \] 

Implemented in \mbox{\hyperlink{classcalico_1_1sensors_1_1Gyroscope_aa9e8f2f9f740605af3230309ea1d2fb2}{calico\+::sensors\+::\+Gyroscope}}, \mbox{\hyperlink{classcalico_1_1sensors_1_1Camera_aa87667f9855c3777686456a94e7ca341}{calico\+::sensors\+::\+Camera}}, and \mbox{\hyperlink{classcalico_1_1sensors_1_1Accelerometer_a1939986d8304f60a1ed2d67dfd6efd1e}{calico\+::sensors\+::\+Accelerometer}}.

\mbox{\Hypertarget{classcalico_1_1sensors_1_1Sensor_af08e6476f0188cdb77cf912a9026709a}\label{classcalico_1_1sensors_1_1Sensor_af08e6476f0188cdb77cf912a9026709a}} 
\index{calico::sensors::Sensor@{calico::sensors::Sensor}!UpdateResiduals@{UpdateResiduals}}
\index{UpdateResiduals@{UpdateResiduals}!calico::sensors::Sensor@{calico::sensors::Sensor}}
\doxysubsubsection{\texorpdfstring{UpdateResiduals()}{UpdateResiduals()}}
{\footnotesize\ttfamily virtual absl\+::\+Status calico\+::sensors\+::\+Sensor\+::\+Update\+Residuals (\begin{DoxyParamCaption}\item[{ceres\+::\+Problem \&}]{problem }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Update residuals for this sensor. 

This will only apply to measurements not marked as outliers.~\newline
~\newline
{\bfseries{Note\+: This method is meant to be invoked by \mbox{\hyperlink{classcalico_1_1BatchOptimizer}{Batch\+Optimizer}} ONLY. It is not recommended that you invoke this method manually.}} 

Implemented in \mbox{\hyperlink{classcalico_1_1sensors_1_1Gyroscope_a7fa5504f378220271a8ffdfadc9e6fff}{calico\+::sensors\+::\+Gyroscope}}, \mbox{\hyperlink{classcalico_1_1sensors_1_1Camera_a9baffab8e9436f340279bababa7647eb}{calico\+::sensors\+::\+Camera}}, and \mbox{\hyperlink{classcalico_1_1sensors_1_1Accelerometer_aa6bd00426c947a719e8889a8c9671447}{calico\+::sensors\+::\+Accelerometer}}.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
calico/sensors/sensor\+\_\+base.\+h\end{DoxyCompactItemize}
